//package com.github.llyb120.workflow.inter;
//
//import cn.hutool.core.io.FileUtil;
//import com.alibaba.fastjson.JSON;
//import com.github.llyb120.workflow.entity.FlowData;
//
//import java.io.File;
//import java.util.concurrent.locks.ReentrantLock;
//
//public class FileStorageImpl implements Storage{
//    private File dir = new File("D:\\work\\cal-engine\\data");
//    private ReentrantLock lock = new ReentrantLock();
//
//    @Override
//    public void save(FlowData flowData) {
//        lock.lock();
//        try{
//            FileUtil.writeUtf8String(JSON.toJSONString(flowData), new File(dir, flowData.getId() + ".json"));
//        } finally {
//            lock.unlock();
//        }
//    }
//
//    @Override
//    public FlowData findFlowData(String id) {
//        return null;
//    }
//}
